package com.srwl.mytx.widget;

import android.content.Context;
import android.util.AttributeSet;
import android.widget.FrameLayout;

import com.srwl.mytx.tao.av.ClipManager;


public class SquareFrameLayout extends FrameLayout   {
    private ClipManager.Listener _OnSizeChangedListener;

    public SquareFrameLayout(Context context) {
        super(context);
    }

    public SquareFrameLayout(Context context, AttributeSet attrs, int defStyle) {
        super(context, attrs, defStyle);
    }

    public SquareFrameLayout(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
        super.onMeasure(widthMeasureSpec, widthMeasureSpec);
        int width = this.getMeasuredWidth();
        this.setMeasuredDimension(width, width);
    }

    public void setOnSizeChangedListener(ClipManager.Listener listener) {
        this._OnSizeChangedListener = listener;
    }

    protected void onSizeChanged(int w, int h, int oldw, int oldh) {
        super.onSizeChanged(w, h, oldw, oldh);
//        if (this._OnSizeChangedListener != null) {
//            this._OnSizeChangedListener.onSizeChanged(this, w, h, oldw, oldh);
//        }

    }
}